package com.zhj.controller;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

/**
 * Copyright: Copyright (c) 2020 hantu
 *
 * @ClassName: test
 * @Description:
 * @version: v1.0.0
 * @author: zhanghaojie
 * @date: 2020/5/16
 */
public class test {
    public static void main(String[] args) {
        List<Double> list=new ArrayList<>() ;
        list.add(1.1);
        list.add(2.2);
        Optional<Double> reduce = list.stream().reduce((n1, n2) -> (n1 + n2));
        System.out.println(reduce.get());
    }
}
